<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 外观模式

        // 场景描述 需求人员提出需求 开发人员开发 测试人员测试

        // 开发人员
        function Developter(){
            this.develop = function(demand_name){
                console.log("头发好撸秃头发在写"+demand_name);
            }
        }
        // 测试人员
        function Tester(){
            this.test = function(demand_name){
                console.log("深夜加班完成"+demand_name);
            }
        }
        // 需求人员
        function Leader(){
            var developer = new Developter()
            var tester = new Tester()
            this.processDemand = function(demand_name){
                developer.develop(demand_name)
                tester.test(demand_name)
            }
        }
        function Demander(){
            var leader = new Leader()
            this.demand = function(demand_name){
                console.log("万恶之源提出需求"+demand_name);
                leader.processDemand(demand_name)
            }
        }
        var demand_name = "游戏"
        var demandr = new Demander() 
        demandr.demand(demand_name)

    </script>
</body>

</html>